package automaticExecution

import (
	cron "github.com/robfig/cron/v3"
	"newRetailByGolang/service"
)

func init(){
	 //service := new(service.RetailService)
	service := service.NewRetailService()

	cronRetail := cron.New()
	task := func() {
		service.HandleTask()
	}

	// 添加定时任务, * * * * * 是 crontab,表示每分钟执行一次
	cronRetail.AddFunc("* * * * *", task)
	// 启动定时器
	cronRetail.Start()
}

